<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .mycls{
            background-color: red;
        }
    </style>
    <script>
        window.onload=function () {
            console.log(document.getElementById('name'));
            console.log(document.querySelector('#name'));
            console.log(document.getElementsByTagName('input'));
            console.log(document.getElementsByClassName('mycls'));
        }
    </script>
</head>
<body>

<input id="name" type="text" name="name" class="mycls">
<input id="name1" type="text" name="name1" class="mycls">
</body>
</html>